//
//  BMSnomPhone.h
//  snomPhone
//
//  Created by Daniel Hazelbaker on 11/2/08.
//  Copyright 2008 Blue Box Moon. All rights reserved.
//

#import <Cocoa/Cocoa.h>


@interface BMSnomPhone : NSObject {
    NSString		*phoneAddress, *phonePassword;

    NSDictionary	*callHistory;
    NSMutableDictionary	*phoneSettings;
}

+ (BMSnomPhone *)sharedPhone;
+ (NSString *)strippedPhoneNumber:(NSString *)phone;
+ (NSString *)formatPhoneNumber:(NSString *)number;

- (id)initWithAddress:(NSString *)address;
- (id)initWithAddress:(NSString *)address password:(NSString *)password;

- (NSURL *)buildPhoneURL:(NSString *)urlPath;
- (NSString *)requestPhoneURL:(NSString *)urlPath postData:(NSString *)postData;

- (void)loadCallHistory;
- (NSDictionary *)processCallHistoryNode:(NSXMLNode *)node isMissed:(BOOL)missed;
- (void)loadPhoneSettings;
- (void)setPhoneSetting:(id)value forKey:(NSString *)key;
- (void)setPhoneSettingsFromDictionary:(NSDictionary *)settings;

- (NSDictionary *)callHistory;
- (NSDictionary *)phoneSettings;

- (void)dialPhoneNumber:(NSString *)phoneNumber;

@end
